﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Chinaer.Win
{
    public partial class AddCountry : Form
    {
        public AddCountry()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            DTO.CountryDTO countryDTO = new DTO.CountryDTO()
            {
                CountryCode = this.txtCode.Text.Trim(),
                CountryName = this.txtName.Text.Trim(),
                ID = Guid.NewGuid().ToString().Replace("-", "")
            };
            var jsonResult = ChinaerService.Instance.AddCountry(countryDTO);
            MessageBox.Show(jsonResult.ErrorMessage.ToString());
        }
    }
}
